<?php
function getMaxId_f( $array, $store ) {
    $max = 0;
    $id = 0;

    foreach( $array as $idx => $value ) {
        if ( $value > $max ) {
            $max = $value;
            $id = $idx;
        }
    }

    return $id;
}

function ifsetor( &$a, $b = NULL ) {
    return !isset($a) ? $b : $a;
}